import service from '@/utils/request'

const BASE_URL = 'api-system/sys/dict'

export function DictList(data) {
    return service({
        url: BASE_URL + '/key',
        method: 'get',
        params: data
    })
}
// 新增字典
export function addDict(data) {
    return service({
        url: BASE_URL + '/key',
        method: 'post',
        data: data
    })
}
// 修改字典
export function editDict(data) {
    return service({
        url: BASE_URL + '/key',
        method: 'put',
        data: data
    })
}
// 删除字典deleteDict
export function deleteDict(dictKeyId) {
    return service({
        url: `${BASE_URL}/key/${dictKeyId}`,
        method: 'delete'
    })
}

// 保存数据字典配置
export function getConfigDict(dictKeyId) {
    return service({
        url: `${BASE_URL}/key/${dictKeyId}`,
        method: 'get'
    })
}

// 保存数据字典配置
export function configDict(dictKeyId,data) {
    return service({
        url: `${BASE_URL}/key/${dictKeyId}`,
        method: 'post',
        data: data
    })
}
